package experiment_2.TDD;

import experiment_2.TDD.MyUtility;
import junit.framework.TestCase;
import org.junit.Test;

/**
 * Created by Administrator on 2016/4/12.
 */
public class MyUtilityTest extends TestCase {
    @Test
    public void testNormal(){
        assertEquals("不及格", MyUtility.percentage2fivegrade(55));
        assertEquals("及格", MyUtility.percentage2fivegrade(65));
        assertEquals("中等", MyUtility.percentage2fivegrade(75));
        assertEquals("良好", MyUtility.percentage2fivegrade(85));
        assertEquals("优秀", MyUtility.percentage2fivegrade(95));
    }
    @Test
    public void testException(){
        assertEquals("错误",MyUtility.percentage2fivegrade(105));
        assertEquals("错误",MyUtility.percentage2fivegrade(-55));
    }
    @Test
    public void testBoundary(){
        assertEquals("不及格",MyUtility.percentage2fivegrade(0));
        assertEquals("及格",MyUtility.percentage2fivegrade(60));
        assertEquals("中等",MyUtility.percentage2fivegrade(70));
        assertEquals("良好",MyUtility.percentage2fivegrade(80));
        assertEquals("优秀",MyUtility.percentage2fivegrade(90));
        assertEquals("优秀",MyUtility.percentage2fivegrade(100));
    }
}